package es.andresimon.portfolio.domain;

import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import org.springframework.roo.addon.entity.RooEntity;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.springframework.format.annotation.DateTimeFormat;
import es.andresimon.portfolio.security.UserRole;
import javax.persistence.Enumerated;

@RooJavaBean
@RooToString
@RooEntity(finders = { "findProjectsByUserRole" })
public class Project {

    private Long projectId;

    private Integer weight;

    @NotNull
    @Size(min = 1, max = 50)
    private String title;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date projectDate;

    @NotNull
    private Long frontPicture;

    @NotNull
    @Size(min = 1, max = 4000)
    private String introduction;

    @NotNull
    @Size(min = 1, max = 10000)
    private String column1;

    @Size(min = 0, max = 10000)
    private String column2;

    private Boolean visibility;

    @Size(min = 0, max = 500)
    private String url;

    @Size(min = 0, max = 1000)
    private String video;

    @Enumerated
    private UserRole userRole;
}
